﻿using System;
using System.Linq;

namespace Terraria.GameInput
{
	// Token: 0x020003B8 RID: 952
	public class TriggersPack
	{
		// Token: 0x06002168 RID: 8552 RVA: 0x0001752D File Offset: 0x0001572D
		public void Initialize()
		{
			this.Current.SetupKeys();
			this.Old.SetupKeys();
			this.JustPressed.SetupKeys();
			this.JustReleased.SetupKeys();
		}

		// Token: 0x06002169 RID: 8553 RVA: 0x0001755B File Offset: 0x0001575B
		public void Reset()
		{
			this.Old = this.Current.Clone();
			this.Current.Reset();
		}

		// Token: 0x0600216A RID: 8554 RVA: 0x00017579 File Offset: 0x00015779
		public void Update()
		{
			this.CompareDiffs(this.JustPressed, this.Old, this.Current);
			this.CompareDiffs(this.JustReleased, this.Current, this.Old);
		}

		// Token: 0x0600216B RID: 8555 RVA: 0x00468D0C File Offset: 0x00466F0C
		public void CompareDiffs(TriggersSet Bearer, TriggersSet oldset, TriggersSet newset)
		{
			Bearer.Reset();
			foreach (string key in Bearer.KeyStatus.Keys.ToList<string>())
			{
				Bearer.KeyStatus[key] = (newset.KeyStatus[key] && !oldset.KeyStatus[key]);
			}
		}

		// Token: 0x04003E0B RID: 15883
		public TriggersSet Current = new TriggersSet();

		// Token: 0x04003E0C RID: 15884
		public TriggersSet Old = new TriggersSet();

		// Token: 0x04003E0D RID: 15885
		public TriggersSet JustPressed = new TriggersSet();

		// Token: 0x04003E0E RID: 15886
		public TriggersSet JustReleased = new TriggersSet();
	}
}
